package com.kaifamiao.thread.d0928.pm;

import java.io.OutputStream;
import java.net.Socket;

public class TCPClient {

    public static void main(String[] args) throws Exception{
        Socket socket = new Socket("localhost", 8888);

        OutputStream outputStream = socket.getOutputStream();

        outputStream.write("国庆节放七天假".getBytes());

        socket.shutdownOutput();

        byte[] bytes = socket.getInputStream().readAllBytes();

        System.out.println("回复是: " + new String(bytes));
    }
}
